<?php

/**
 * Invoice form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseInvoiceForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'invoice_id'                 => new sfWidgetFormInputHidden(),
      'account_id'                 => new sfWidgetFormPropelChoice(array('model' => 'Account', 'add_empty' => false)),
      'applied_payment_total'      => new sfWidgetFormInput(),
      'balance_due'                => new sfWidgetFormInput(),
      'created'                    => new sfWidgetFormDateTime(),
      'modified'                   => new sfWidgetFormDateTime(),
      'discount'                   => new sfWidgetFormInput(),
      'shipping_price'             => new sfWidgetFormInput(),
      'shipping_date'              => new sfWidgetFormDate(),
      'shipping_method'            => new sfWidgetFormInput(),
      'subtotal'                   => new sfWidgetFormInput(),
      'tax'                        => new sfWidgetFormInput(),
      'total'                      => new sfWidgetFormInput(),
      'total_weight'               => new sfWidgetFormInput(),
      'ip_addr'                    => new sfWidgetFormInput(),
      'contacted_about_incomplete' => new sfWidgetFormInput(),
      'is_printable'               => new sfWidgetFormInput(),
      'google_order'               => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'invoice_id'                 => new sfValidatorPropelChoice(array('model' => 'Invoice', 'column' => 'invoice_id', 'required' => false)),
      'account_id'                 => new sfValidatorPropelChoice(array('model' => 'Account', 'column' => 'account_id')),
      'applied_payment_total'      => new sfValidatorNumber(array('required' => false)),
      'balance_due'                => new sfValidatorNumber(array('required' => false)),
      'created'                    => new sfValidatorDateTime(),
      'modified'                   => new sfValidatorDateTime(),
      'discount'                   => new sfValidatorNumber(array('required' => false)),
      'shipping_price'             => new sfValidatorNumber(array('required' => false)),
      'shipping_date'              => new sfValidatorDate(array('required' => false)),
      'shipping_method'            => new sfValidatorInteger(array('required' => false)),
      'subtotal'                   => new sfValidatorNumber(array('required' => false)),
      'tax'                        => new sfValidatorNumber(array('required' => false)),
      'total'                      => new sfValidatorNumber(array('required' => false)),
      'total_weight'               => new sfValidatorInteger(array('required' => false)),
      'ip_addr'                    => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'contacted_about_incomplete' => new sfValidatorInteger(array('required' => false)),
      'is_printable'               => new sfValidatorInteger(array('required' => false)),
      'google_order'               => new sfValidatorString(array('max_length' => 24, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('invoice[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Invoice';
  }


}
